<template>
  <div class="sync-son">
    <h3>我是子组件</h3>
    <h4>{{ num }}</h4>
    <button @click="add">点击+1</button>
  </div>
</template>
<script>
export default {
  props: {
    num: {
      type: Number,
      default: 999
    }
  },
  methods: {
    add() {
      this.$emit('update:num', this.num + 1)
    }
  }
}
</script>
<style lang="scss" scoped>
.sync-son {
  width: 400px;
  height: 400px;
  border: 5px solid red;
}
</style>
